﻿using System;
using System.Collections.Generic;
using System.Text;

namespace 继承_base
{
	//继承Person
	class Student :Person
	{
		public Student(int id,string name,int age,char gender):base(name,age,gender)
		{
			Id = id;
		}
		private int _id;

		public int Id { get => _id; set => _id = value; }
		public void Study()
		{
			Console.WriteLine("学生会学习");
		}
		public new void SayHello()
		{
			Console.WriteLine("学生说hello");
		}

		//new可以隐藏父类中同名的方法
	}
}
